jevstrudel.git / website / src / pages / jev / catalog / [theme] / [song].json.js

One site song whole, for the hosted MCP's get_song (worker/src/catalog.ts): its spec as the art critic reads it (the SPEC.md body) and its code.

3import { loadSongs } from '../../../../jev/songs.mjs';
5export async function getStaticPaths() {
6  return (await loadSongs()).map((s) => {
7    const [theme, song] = s.id.split('/');
8    return {
9      params: { theme, song },
10      props: { song: { id: s.id, title: s.title, theme: s.theme, description: s.description, spec: s.spec, code: s.code } },
11    };
12  });
13}
14
15export function GET({ props }) {
16  return new Response(JSON.stringify(props.song), { headers: { 'Content-Type': 'application/json' } });
17}